package com.gitee.feizns.dynamic.bean;

import com.gitee.feizns.dynamic.convert.Converter;
import com.gitee.feizns.dynamic.convert.DefaultConverter;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * <b>在实体类转换过程中尝试从source对象中获取的属性名</b>
 * <p>
 *     优先在属性的set函数上获取
 * </p>
 * @see Prop#tryGet(Object)
 * @author feizns
 * @since 2019/8/16
 */
@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface TryGet {

    /**
     * <b>支持过来的属性名</b>
     */
    String[] value();

    /**
     * <b>在属性copy过来之前的转换器</b>
     */
    Class<? extends Converter> converter() default DefaultConverter.class;

}
